<template>
  <div class="newsinfo-con">
    <div class="header">
    <h3>{{newsinfo.title}}</h3>
    <p>
        <span>发表时间：{{newsinfo.add_time | dataFormat()}}</span>
        <span>点击：{{newsinfo.click}}</span>
    </p>
    </div>
    <hr>
        <div v-html="newsinfo.content"></div>
        <cmtbox></cmtbox>
  </div>
</template>

<script>
import monten from "./newcmt.vue"
export default {

  data () {
    return {
        id:this.$route.params.id,
        newsinfo:{}
    }
  },
 created () {
      this.getnewsinfo()
  },
  methods: {
      getnewsinfo(){
          this.$http.get("api/getnew/"+this.id).then(res=>{
              if(res.body.status==0){
                  console.log(res)
                  this.newsinfo=res.body.message[0]
              }
          })
      }
  },
  components:{
      cmtbox:monten
  }

 
}
</script>

<style lang='less'>
    .newsinfo-con{
        padding: 0 5px;
        .header{
            margin:20px 0 10px;
            h3{
                font-size: 14px;
                text-align: center;
                color: red;
                margin-bottom:15px; 
            }
            p{
                font-size: 12px;
                color: blue;
                display: flex;
                justify-content: space-between;
            }
        }
        img{
            width: 100%;
        }
    }
</style>
